Collection Processing with Constraints, Monads, and Folds

نویسنده

  • Ryan Wisnesky
چکیده

We propose an intermediate form based on monad-algebra comprehensions (to represent queries), folds (to represent computation), and setoids over polynomial datatypes (to represent data), suitable for use in collection processing. Such an intermediate form captures, in a uniform way, large fragments of many recent largescale collection processing languages such as MapReduce, PIG, DryadLINQ, and Data Parallel Haskell, and admits optimization techniques from both programming language theory and relational database theory. We show how to solve four key problems inherent in the naive approach by drawing together recent work from both communities. First, we show how fold fusion can be extended, in an arguably complete way, to exploit the monadic structure of queries. Second, we show how monad comprehensions can be extended to monad-algebra comprehensions, so as to express aggregation and thereby enable comprehension-based optimizations for a wide class of queries. Third, we show how to embed a particular syntactic class of constraints called embedded dependencies into our intermediate form and show how such constraints can be used, for example, to minimize the number of bind operations in a monad comprehension a process traditionally known as semantic optimization. Finally, we show how to emit proof obligations from our language, so as to ensure that each program is sound with respect to required axioms (such as the monad laws) as well as user-provided invariants (such as ensuring all sets are represented by lists without duplicates).

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Merging Monads and Folds for Functional Programming

These notes discuss the simultaneous use of generalised fold operators and monads to structure functional programs. Generalised fold operators structure programs after the decomposition of the value they consume. Monads structure programs after the computation of the value they produce. Our programs abstract both from the recursive processing of their input as well as from the side-eeects in co...

متن کامل

Leibniz’s Monads and Mulla Sadra’s Hierarchy of Being: A Comparative Study

Mulla Sadra and Leibniz, the two philosophers from the East and the West, belong to two different worlds. Though they were unaware of the ideas of each other, their philosophical systems share certain common points that are comparable. Monads constitute the basis of Leibniz's thought and he refers to their features in his various works. On the other side, Mulla Sadra's philosophy is also based ...

متن کامل

SINGLE MACHINE DUE DATE ASSIGNMENT SCHEDULING PROBLEM WITH PRECEDENCE CONSTRAINTS AND CONTROLLABLE PROCESSING TIMES IN FUZZY ENVIRONMENT

In this paper, a due date assignment scheduling problem with precedence constraints and controllable processing times in uncertain environment is investigated, in which the basic processing time of each job is assumed to be the symmetric trapezoidal fuzzy number, and the linear resource consumption function is used.The objective is to minimize the crisp possibilistic mean (or expected) value of...

متن کامل

Colimits of Monads

The category of all monads over many-sorted sets (and over other " set-like " categories) is proved to have coequalizers and strong coin-tersections. And a general diagram has a colimit whenever all the monads involved preserve monomorphisms and have arbitrarily large joint pre-fixpoints. In contrast, coequalizers fail to exist e.g. for monads over the (presheaf) category of graphs. For more ge...

متن کامل

Applications of the Kleisli and Eilenberg-Moore 2-adjunctions

In 2010, J. Climent Vidal and J. Soliveres Tur developed, among other things, a pair of 2-adjunctions between the 2-category of adjunctions and the 2-category of monads. One is related to the Kleisli adjunction and the other to the Eilenberg-Moore adjunction for a given monad.Since any 2-adjunction induces certain natural isomorphisms of categories, these can be used to classify bijection...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 2011